<?php
namespace app\topics\service;
/**
 * Html接口
 */
class HtmlService extends \app\base\service\BaseService {

    private $userInfo = [];


    public function getMemberIndexBodyHtml($userInfo) {

        $detailList = target('topics/TopicsDetail')->loadList([
            'A.user_id' => $userInfo['user_id']
        ], 20, 'A.create_time desc');

        $html = \dux\Dux::view()->fetch('app/topics/view/service/member/indexbody', [
            'detailList' => $detailList
        ]);

        return [
            [
                'name' => '社区模块',
                'order' => 99,
                'html' => $html
            ]
        ];

    }

    public function getMemberIndexSideHtml($userInfo) {
        $detailList = target('topics/TopicsDetail')->loadList([
            'A.user_id' => $userInfo['user_id'],
            //'attr_excellent' => 1,
        ], 10, 'A.create_time desc');
        $html = \dux\Dux::view()->fetch('app/topics/view/service/member/indexside', [
            'detailList' => $detailList
        ]);
        return [
            [
                'name' => '社区边栏模块',
                'order' => 99,
                'html' => $html
            ]
        ];
    }


}

